<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<html>
    <head>
        <meta charset="UTF-8">
        <title>Controle de Pagamento</title>
        <style>
            
            .btn-file {
    position: relative;
    overflow: hidden;
}
.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 999px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
   
}

.usual {
  background:#181818;
  color:#111;
  padding:15px 20px;
  width:500px;
  border:1px solid #222;
  margin:8px auto;
}
.usual li { list-style:none; float:left; }
.usual ul a {
  display:block;
  padding:6px 10px;
  text-decoration:none!important;
  margin:1px;
  margin-left:0;
  font:10px Verdana;
  color:#FFF;
  background:#444;
}
.usual ul a:hover {
  color:#FFF;
  background:#111;
  }
.usual ul a.selected {
  margin-bottom:0;
  color:#000;
  background:snow;
  border-bottom:1px solid snow;
  cursor:default;
  }
.usual div {
  padding:10px 10px 8px 10px;
  *padding-top:3px;
  *margin-top:-15px;
  clear:left;
  background:snow;
  font:10pt Georgia;
}
.usual div a { color:#000; font-weight:bold; }


            
            
        </style>
<script type="text/javascript" src="js/jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/redmond/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <script>
  $(function() {
    $( "#tabs" ).tabs({
      collapsible: true
    });
  });
  </script>


    </head>
     <link rel="stylesheet" href="css/bootstrap.css">
     <body >
        <?php
        // put your code here
         require_once 'conecta.php';
            include "verifica.php"; 
           
            $id  = $_SESSION["id"];
           // $sql = "SELECT * FROM participantes WHERE id ='$id'";
            $sql= "SELECT * FROM participantes WHERE email ='$id'"; 
            $res1= mysql_query($sql);
            $num = mysql_num_rows($res1); //pegando quanto de linha afeta do pelo sql
            $verificador= 0;

           if($num==0){

               echo "nao encontrou";

           }else{

                  $registroUser = mysql_fetch_row($res1);
                  $id =$registroUser[0];
                  $aux= $registroUser[0];
                  $email =$registroUser[1];
                  $senha =$registroUser[2];
                  $equipe = $registroUser[3];
                  $part1 =$registroUser[4];
                  $part2 =$registroUser[5];
                  $part3 =$registroUser[6];
                  $part4 =$registroUser[7];
                  $part5 =$registroUser[8];
                  $situacao =$registroUser[9];
                  $autentica = $registroUser[10];

            
           }
           $sql5 = "SELECT * FROM userPagamento WHERE id_part='$id'"; 
           $res5 = mysql_query($sql5);
           $num5 = mysql_num_rows($res5);
           if($num5 == 0){
                

                 $verificador = 1;

           }else{


                   $registroPag = mysql_fetch_row($res5);
                   $idPag1= $registroPag[0];
                   $cpf1= $registroPag[1];
                   $rg1= $registroPag[2];
                   $fone1= $registroPag[3];
                   $id_part1= $registroPag[4];






           }


        ?>

           <div class="jumbotron">
              <div class="container">
              <h1>Pagamento</h1>              
              </div>
            </div>
                
                <div class="panel panel-default">
                        <div class="panel-heading">
                                  <div class="row">
                                      <div class="col-md-4">
                                        
                                             <div class="panel panel-primary">
                                                 <div class="panel-heading" ><strong>Equipe : <?php echo $equipe ?></strong></div>
                                                      <div class="panel-body">
                                                           <address>
                                                              
                                                               <strong>Participantes :</strong><br><br>
                                                                <strong>P : </strong> <?php echo $part1;?> <strong>(Capitão)</strong><br>
                                                                <?php echo $part2?><br>
                                                                <?php echo $part3?><br>
                                                                <?php echo $part4?><br>
                                                                <?php echo $part5?><br>
                                                                <abbr title="Phone">P:</abbr> (123) 456-7890 <br> <br>                                                             
                                                                <strong>Email :</strong>
                                                                <a href="mailto:#">  <?php echo $email ?></a> <br><br>
                                                                        <dl>
                                                                         <dt>Situação:</dt>                                                                       
                                                                             <dd style="color: red"><?php echo $situacao?></dd>
                                                                        </dl>

                                                                             <strong>CPF:<?php echo $cpf1 ?></strong><br><br>
                                                                                <strong>RG:<?php echo $rg1 ?></strong><br><br>
                                                                                <strong>Telefone:<?php echo $fone1 ?></strong>

                                                             </address>    
                                                      </div>                    
                                               
                                             </div>                                  
                                      </div>                                 
             
                                    <div class="col-md-8" >                                        
                                          <div class="panel panel-success">
                                               <div class="panel panel-default">
                                                    <div id="tabs">
                                                          <ul>                                                          
                                                            <li><a href="#tabs-2">Dados Pessoas</a></li>
                                                            <li><a href="#tabs-3">Finalizar</a></li>
                                                          </ul>
                                                          
                                                          
                                                          <div id="tabs-2">                                                              
                                                                  <div class="row"> 
                                                                        
                                                                     
                                                                        <div class="col-md-5">

                                                                          <strong> <span class="label label-success">Cadastro dados pessoais</span></strong>
                                                                          <br><br>
                                                                         <form class="form-horizontal" role="form" action="<?php $_SERVER['PHP_SELF'];?>" method="post" >
                                                                          <div class="form-group">
                                                                               <label for="inputEquipe" class="col-sm-3 control-label">CPF</label>
                                                                           <div class="col-sm-8">
                                                                               <input type="text" class="form-control" id="inputEmail3" placeholder="___.___.___-__" name="cpf" size="11" maxlength="11">
                                                                           </div>
                                                                           </div>
                                                                           <div class="form-group">
                                                                                <label for="inputEmail3" class="col-sm-3 control-label">RG</label>
                                                                           <div class="col-sm-8">
                                                                                <input type="partc1" class="form-control" id="inputError1" id="inputEmail3" placeholder="RG" name="rg" maxlength="6">
                                                                           </div>
                                                                           </div>
                                                                           <div class="form-group">
                                                                                <label for="inputPartipante" class="col-sm-3 control-label">Telefone</label>
                                                                           <div class="col-sm-8">
                                                                                <input type="partc2" class="form-control" id="inputPassword3" placeholder="Telefone" name="fone" maxlength="12">
                                                                           </div>
                                                                          </div>
                                                                          
                                                                                <button type="submit" class="btn btn-primary" name="enviar">Confirma Dados</button>
                                                                      </form>                                                            
                                                                       
                                                                 

                                                                          </div>     
                                                                            <div class="col-md-5">
                                                                                 <?php
                                                                                     
                                                                                     $cpf = $_POST['cpf'];
                                                                                     $rg = $_POST['rg'];
                                                                                     $fone = $_POST['fone'];
                                                                                  


                                                                                     // $sql = "SELECT * FROM participantes WHERE id ='$id'";
                                                                                      $sql1= "SELECT * FROM userPagamento WHERE cpf ='$cpf' OR id_part='$id'"; 
                                                                                      $res3= mysql_query($sql1);
                                                                                      $num3 = mysql_num_rows($res3); //pegando quanto de linha afeta do pelo sql

                                                                                     if($num3==0){

                                                                                        
                                                                                      $sql2 ="INSERT INTO userPagamento (id,CPF,RG,telefone,id_part) VALUES ('','$cpf','$rg','$fone','$id')";
                                                                                       if(isset($_POST["enviar"])){
                                                                                         $res2 =mysql_db_query("camplol",$sql2);
                                                                                           
                                                                                         if($res2){
                     
                                                                                                      ?>
                                                                                                     
                                                                                                         <div class="alert alert-success">Dados Pessoas Cadastrado</div>

                                                                                          <?php 
                                                                                               
                                                                                                 }else{
                                                                                                     
                                                                                                     $erro= mysql_error();
                                                                                                      echo "erro em $email cadastrar equipe ->".$erro;
                                                                                                      
                                                                                                 }

                                                                                              }
                                                                                              unset($_POST["enviar"]);  

                                                                                     }else{

                                                                                         if($verificador == 0){

                                                                                           $registroUserPag = mysql_fetch_row($res3);
                                                                                            if(isset($_POST["enviar"])){
                                                                                            $sql4= "UPDATE userPagamento SET id='',CPF='$cpf',RG='$rg',telefone='$fone',i WHERE id_part= '$id'";
                                                                                              $res4 =mysql_db_query("camplol",$sql4);



                                                                                         }

                                                                                            
                                                                                           
                                                                                                
                                                                                            }

                                                                                      
                                                                                     }
                                                                          



                                                                                    ?>


                                                                                   
                                                                               

                                                                               <br/>  <strong>CPF</strong>: <?php echo $_POST["cpf"];?><br/><br/>
                                                                                 <strong>RG</strong>: <?php echo $_POST["rg"];?><br/><br/>
                                                                                <strong>Telefone</strong>: <?php echo $_POST["fone"];?><br/>

                                                                             </div>            
                                                              

                                                                </div>
                                                              
                                                                                    
                                                              
                                                         </div>
                                  
                            
                            <div id="tabs-3">
                               <div class="panel panel-default">
                                                          <div class="panel-body">
                                                  <strong> <span class="label label-success">Pagseguro</span>    </strong>
                                                    <br/>
                                                     <br/>
                                                      <form class="form-inline" action="boleto_cef.php" method="post">
         
    
                                                       <button type="submit" class="btn btn-primary" name="pagar">Pagamento</button>
                                                              
                                                      </form>
                                                        <br>
                                                        <hr>
                                                              <span class="btn btn-default btn-file">
                                                        Enviar Comprovante <input type="file">
                                                      </span>
                                                          </div>
                                   </div> 
                            </div>
                         
                </div> 

                                                        
                                              </div>                               
                    
                                          </div>            
                                    </div> <!-- painel green -->                                          
                                </div><!--row -->                                                                           
                           </div><!--panel-heading-->
                      </div><!--panel panel-default-->
                       
  <div class="panel-body">
   
    <!-- ... aqui vai o <dl> que já temos hoje ... -->
   <ul class="nav nav-pills">
       &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  <strong style="font-size: 30px;">Usuario</strong> :  <a style="font-size:28px;"><?php echo $_SESSION["nome"]?> </a>
     <li class="active"><a href="logout.php">Sair</a></li>  
  
</ul>

  </div>
                    

</div>
        </div>
         <?php  unset($_POST["enviar"]);?>
      bymarcos
    </body>

</html>


    